#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2024/3/2 18:40
# @Author  : 1823218990@qq.com
# @File    : help
# @Software: Pycharm
"""
# 查看命令
ffmpeg -h  #最基本命令
ffmpeg -h long #较丰富的命令
ffmpeg -h full #全部命令
ffmpeg -h full | findstr 264  #检索带有字符串246的命令
ffmpeg -formats # 列出所有支持的格式
"""
"""
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Getting help:
    -h      -- print basic options
    -h long -- print more options
    -h full -- print all options (including all format and codec specific options, very long)
    -h type=name -- print all options for the named decoder/encoder/demuxer/muxer/filter/bsf/protocol
    See man ffmpeg for detailed description of the options.

Per-stream options can be followed by :<stream_spec> to apply that option to specific streams only. <stream_spec> can be a stream index, or v/a/s for video/audio/subtitle (see manual for full syntax).

Print help / information / capabilities:
-L                  show license
-h <topic>          show help
-version            show version
-muxers             show available muxers
-demuxers           show available demuxers
-devices            show available devices
-decoders           show available decoders
-encoders           show available encoders
-filters            show available filters
-pix_fmts           show available pixel formats
-layouts            show standard channel layouts
-sample_fmts        show available audio sample formats

Global options (affect whole program instead of just one file):
-v <loglevel>       set logging level
-y                  overwrite output files
-n                  never overwrite output files
-stats              print progress report during encoding

Per-file options (input and output):
-f <fmt>            force container format (auto-detected otherwise)
-t <duration>       stop transcoding after specified duration
-to <time_stop>     stop transcoding after specified time is reached
-ss <time_off>      start transcoding at specified time


Per-file options (output-only):
-metadata[:<spec>] <key=value>  add metadata

Per-stream options:
-c[:<stream_spec>] <codec>  select encoder/decoder ('copy' to copy stream without reencoding)
-filter[:<stream_spec>] <filter_graph>  apply specified filters to audio/video

Video options:
-r[:<stream_spec>] <rate>  override input framerate/convert to given output framerate (Hz value, fraction or abbreviation)
-aspect[:<stream_spec>] <aspect>  set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)
-vn                 disable video
-vcodec <codec>     alias for -c:v (select encoder/decoder for video streams)
-vf <filter_graph>  alias for -filter:v (apply filters to video streams)
-b <bitrate>        video bitrate (please use -b:v)

Audio options:
-aq <quality>       set audio quality (codec-specific)
-ar[:<stream_spec>] <rate>  set audio sampling rate (in Hz)
-ac[:<stream_spec>] <channels>  set number of audio channels
-an                 disable audio
-acodec <codec>     alias for -c:a (select encoder/decoder for audio streams)
-ab <bitrate>       alias for -b:a (select bitrate for audio streams)
-af <filter_graph>  alias for -filter:a (apply filters to audio streams)

Subtitle options:
-sn                 disable subtitle
-scodec <codec>     alias for -c:s (select encoder/decoder for subtitle streams)

"""

"""
视频格式	说明
RMVB	较为封闭
MKV	    最开放 几乎支持所有的音视频 但体积太大
AVI	    有点老 已经不适应最近的音视频
MOV	    主流 苹果公司制定、支持透明视频
MP4	    最主流 软硬件厂商都大力支持
"""

"""
分辨率
720p  =  1280x720      码率2048-3072kbps
1080p =  1920x1080     码率5120-8192kbps
2k    =  2048x1080
4k    =  4096x2160

ord('x') = 120
"""

"""
ffmpeg.exe -f concat -safe 0 -i filelist.txt -c copy output.mp4

```filelist.txt```
file 'jq_01.mp4'
inpoint 500
outpoint 600
```
"""